home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 2: CDPD 1
/
Almathera Ten on Ten - Disc 2: CDPD 1.iso
/
pd
/
051-075
/
069
/
monproc
/
givepkt.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-03-13
|
4KB
|
220 lines
/* givepkt.c - This doesn't do much, it takes a packet type (number) and
* gives you something more readable on stdout.
*
* Phillip Lindsay (c) 1987 Commodore-Amiga Inc.
* You may use this source as long as the copyright notice is left intact.
*
*/
#include <exec/types.h>
#include <libraries/dosextens.h>
/* packet types */
#define _ACTION_NIL 0L
#define _ACTION_GET_BLOCK 2L
#define _ACTION_SET_MAP 4L
#define _ACTION_DIE 5L
#define _ACTION_EVENT 6L
#define _ACTION_CURRENT_VOLUME 7L
#define _ACTION_LOCATE_OBJECT 8L
#define _ACTION_RENAME_DISK 9L
#define _ACTION_FREE_LOCK 15L
#define _ACTION_DELETE_OBJECT 16L
#define _ACTION_RENAME_OBJECT 17L
#define _ACTION_MORE_CACHE 18L
#define _ACTION_COPY_DIR 19L
#define _ACTION_WAIT_CHAR 20L
#define _ACTION_SET_PROTECT 21L
#define _ACTION_CREATE_DIR 22L
#define _ACTION_EXAMINE_OBJECT 23L
#define _ACTION_EXAMINE_NEXT 24L
#define _ACTION_DISK_INFO 25L
#define _ACTION_INFO 26L
#define _ACTION_FLUSH 27L
#define _ACTION_SET_COMMENT 28L
#define _ACTION_PARENT 29L
/* This is normally a returning timer device request. (internal) */
#define _ACTION_TIMER 30L
#define _ACTION_INHIBIT 31L
#define _ACTION_DISK_TYPE 32L
#define _ACTION_DISK_CHANGE 33L
#define _ACTION_SET_FILE_DATE 34L
#define _ACTION_READ 82L
#define _ACTION_WRITE 87L
#define _ACTION_SET_SCREEN_MODE 994L
/*
* When a handler internally sends a device i/o request they are sent using
* their process port and in the form of a "packet" the packet types below:
* (ACTION_TIMER above also falls into this catagory)
*/
#define _ACTION_READ_INTERNAL 1001L
#define _ACTION_WRITE_INTERNAL 1002L
#define _ACTION_FIND_INPUT 1005L
#define _ACTION_FIND_OUTPUT 1006L
#define _ACTION_CLOSE 1007L
#define _ACTION_SEEK 1008L
void givepkt(pkt)
struct DosPacket *pkt;
{
switch(pkt->dp_Type)
{
case _ACTION_NIL:
puts("ACTION_NIL");
break;
case _ACTION_GET_BLOCK:
puts("ACTION_GET_BLOCK");
break;
case _ACTION_SET_MAP:
puts("ACTION_SET_MAP");
break;
case _ACTION_DIE:
puts("ACTION_DIE");
break;
case _ACTION_EVENT:
puts("ACTION_EVENT");
break;
case _ACTION_CURRENT_VOLUME:
puts("ACTION_CURRENT_VOLUME");
break;
case _ACTION_LOCATE_OBJECT:
puts("ACTION_LOCATE_OBJECT");
break;
case _ACTION_RENAME_DISK:
puts("ACTION_RENAME_DISK");
break;
case _ACTION_FREE_LOCK:
puts("ACTION_FREE_LOCK");
break;
case _ACTION_DELETE_OBJECT:
puts("ACTION_DELETE_OBJECT");
break;
case _ACTION_RENAME_OBJECT:
puts("ACTION_RENAME_OBJECT");
break;
case _ACTION_MORE_CACHE:
puts("ACTION_MORE_CACHE");
break;
case _ACTION_COPY_DIR:
puts("ACTION_COPY_DIR");
break;
case _ACTION_WAIT_CHAR:
puts("ACTION_WAIT_CHAR");
break;
case _ACTION_SET_PROTECT:
puts("ACTION_SET_PROTECT");
break;
case _ACTION_CREATE_DIR:
puts("ACTION_CREATE_DIR");
break;
case _ACTION_EXAMINE_OBJECT:
puts("ACTION_EXAMINE_OBJECT");
break;
case _ACTION_EXAMINE_NEXT:
puts("ACTION_EXAMINE_NEXT");
break;
case _ACTION_DISK_INFO:
puts("ACTION_DISK_INFO");
break;
case _ACTION_INFO:
puts("ACTION_INFO");
break;
case _ACTION_FLUSH:
puts("ACTION_FLUSH");
break;
case _ACTION_SET_COMMENT:
puts("ACTION_SET_COMMENT");
break;
case _ACTION_PARENT:
puts("ACTION_PARENT");
break;
case _ACTION_TIMER:
puts("ACTION_TIMER");
break;
case _ACTION_INHIBIT:
puts("ACTION_INHIBIT");
break;
case _ACTION_DISK_TYPE:
puts("ACTION_DISK_TYPE");
break;
case _ACTION_DISK_CHANGE:
puts("ACTION_DISK_CHANGE");
break;
case _ACTION_SET_FILE_DATE:
puts("ACTION_SET_FILE_DATE");
break;
case _ACTION_READ:
puts("ACTION_READ");
break;
case _ACTION_WRITE:
puts("ACTION_WRITE");
break;
case _ACTION_SET_SCREEN_MODE:
puts("ACTION_SET_SCREEN_MODE");
break;
case _ACTION_READ_INTERNAL:
puts("ACTION_READ_INTERNAL");
break;
case _ACTION_WRITE_INTERNAL:
puts("ACTION_WRITE_INTERNAL");
break;
case _ACTION_FIND_INPUT:
puts("ACTION_FIND_INPUT");
break;
case _ACTION_FIND_OUTPUT:
puts("ACTION_FIND_OUTPUT");
break;
case _ACTION_CLOSE:
puts("ACTION_CLOSE");
break;
case _ACTION_SEEK:
puts("ACTION_SEEK");
break;
default:
printf("Unknown packet: %ld\n",pkt->dp_Type);
break;
}
}
/* end of givepkt.c */